<template>
  <div class="list">
    <div class="listMain ">
      <div class="title flex jc-sb">
        <Input prefix="ios-search" clearable placeholder="模版名称即时搜索" style="width: 300px" />
        <Button type="primary">新建模板</Button>
      </div>
      <Table stripe :columns="columnsT" :data="dataT"></Table>
      <div class="centerPage flex jc-c">
        <Page :total="100" show-sizer show-elevator />
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    data () {
      return {
        columnsT:[
          {
            title: '编号',
            align: 'center',
            key: 'no'
          },
          {
            title: '模板名称',
            align: 'center',
            key: 'tname'
          },
          {
            title: '最后编辑时间',
            align: 'center',
            key: 'lastName'
          },
          {
            title: '模板类型',
            align: 'center',
            key: 'tType'
          },
          {
            title: '等级限制',
            align: 'center',
            key: 'grade'
          },
          {
            title: '段位限制',
            align: 'center',
            key: 'segment'
          },
          {
            title: '适用平台',
            align: 'center',
            key: 'platform'
          },
          {
            title: '适用品类',
            align: 'center',
            key: 'category'
          },
          {
            title: '需求来源',
            align: 'center',
            key: 'demandSource'
          },
          {
            title: '审核状态',
            align: 'center',
            key: 'status'
          },
          {
            title: '操作',
            key: 'action',
            align: 'center',
            // fixed: 'right',
            width: 150,
            render: (h, params) => {
              return h('div', [
                h('span', {
                  style:{
                    color:"#5272E2",
                    cursor: "pointer",
                    padding:"0 5px"
                  },
                  props: {
                    type: 'text',
                    size: 'small'
                  },
                  on: {
                    click: () => {
                      this.goAdd();
                    }
                  }
                }, '编辑'),
                h('span', {
                  style:{
                    color:"#E25252",
                    cursor: "pointer",
                    padding:"0 5px"
                  },
                  props: {
                    type: 'text',
                    size: 'small'
                  },
                  on: {
                    click: () => {
                      
                    }
                  }
                }, '删除')
              ]);
            }
          }
        ],
        dataT:[
          {
            no: '1',
            tname: '京东商品详情模板',
            lastName: '2021/11/11',
            tType: '子模板',
            grade: '10',
          },
        ],
      }
    },
    mounted(){
      
    },
    methods: {
      //跳转测试选择页面
      goAdd(){
        this.$router.push({path:'/template/add'});
      },
    }
  }
</script>

<style lang="scss" scoped>
  .list{
    background-color: #F5F5F5;
    padding: 30px;
    .listMain{
      width: 100%;
      height: calc(100vh - 120px);
      box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.2);
      background-color: #fff;
      padding: 20px;
      overflow-y: scroll;
      position: relative;
      .title{
        padding: 0 0 20px;
      }
      .centerPage{
        padding: 20px 0;
      }
    }
  }
</style>
